<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
    #parse("/h5/common/webWords.html")
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/medioadaption.css">
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/stcss.css">
<script type="text/javascript" src="http://${staticHost}/js/jquery.js"></script>
<script type="text/javascript" src="http://${staticHost}/js/continuingEducation.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
    	
        $("#submitForm").click(function(){
        	showLoading();
        	var level = $("#level").val();
        	var primaryId = $.trim($("#primaryId").val());
        	var primaryPeriod = $.trim($("#primaryPeriod").val());
            var primarySchoolOrWorkUnit = '';
            var primaryReterence = '';
            if(level=="1" ||  level=="2" || level=="3"  ){
                primarySchoolOrWorkUnit = $.trim($("#primarySchoolOrWorkUnit").val());
                primaryReterence = $.trim($("#primaryReterence").val());
            }
        	if(primaryId == '' && (primaryPeriod !='' || primarySchoolOrWorkUnit!='' || primaryReterence!='')){
        		saveWorkExperience(primaryPeriod,'1',primarySchoolOrWorkUnit,primaryReterence);
        	}else if(primaryId != ''){
        		updateWorkExperience(primaryId,primaryPeriod,primarySchoolOrWorkUnit,primaryReterence);
        	}
        	
        	var juniorId = $.trim($("#juniorId").val());
        	var juniorPeriod = $.trim($("#juniorPeriod").val());
            var juniorSchoolOrWorkUnit = "";
            var juniorReterence = "";
            if(level=="1" ||  level=="2" || level=="3"  ){
                juniorSchoolOrWorkUnit = $.trim($("#juniorSchoolOrWorkUnit").val());
                juniorReterence = $.trim($("#juniorReterence").val());
            }

        	if(juniorId == '' && (juniorPeriod !='' || juniorSchoolOrWorkUnit!='' || juniorReterence!='')){
        		saveWorkExperience(juniorPeriod,'2',juniorSchoolOrWorkUnit,juniorReterence);
        	}else if(juniorId != ''){
        		updateWorkExperience(juniorId,juniorPeriod,juniorSchoolOrWorkUnit,juniorReterence);
        	}
        	
        	var seniorId = $.trim($("#seniorId").val());
        	var seniorPeriod = $.trim($("#seniorPeriod").val());
            var seniorSchoolOrWorkUnit = "";
            var seniorReterence = "";
            if(level=="1" ||  level=="2" || level=="3"  ){
                seniorSchoolOrWorkUnit = $.trim($("#seniorSchoolOrWorkUnit").val());
                seniorReterence = $.trim($("#seniorReterence").val());
            }
        	if(seniorId == '' && (seniorPeriod !='' || seniorSchoolOrWorkUnit!='' || seniorReterence!='')){
        		saveWorkExperience(seniorPeriod,'3',seniorSchoolOrWorkUnit,seniorReterence);
        	}else if(seniorId != ''){
        		updateWorkExperience(seniorId,seniorPeriod,seniorSchoolOrWorkUnit,seniorReterence);
        	}

            if(level=="1" ||  level=="2" || level=="3"  ){
                var collegeId = $.trim($("#collegeId").val());
                var collegePeriod = $.trim($("#collegePeriod").val());
                var collegeSchoolOrWorkUnit = $.trim($("#collegeSchoolOrWorkUnit").val());
                var collegeReterence = $.trim($("#collegeReterence").val());
                if(collegeId == '' && (collegePeriod !='' || collegeSchoolOrWorkUnit!='' || collegeReterence!='')){
                    saveWorkExperience(collegePeriod,'4',collegeSchoolOrWorkUnit,collegeReterence);
                }else if(collegeId != ''){
                    updateWorkExperience(collegeId,collegePeriod,collegeSchoolOrWorkUnit,collegeReterence);
                }
            }
        	var work1Id = $.trim($("#work1Id").val());
        	var work1Period = $.trim($("#work1Period").val());
            var work1SchoolOrWorkUnit = "";
            var work1Reterence = "";
            if(level=="1" ||  level=="2" || level=="3"  ){
                work1SchoolOrWorkUnit = $.trim($("#work1SchoolOrWorkUnit").val());
                work1Reterence = $.trim($("#work1Reterence").val());
            }
        	if(work1Id == '' && (work1Period !='' || work1SchoolOrWorkUnit!='' || work1Reterence!='')){
        		saveWorkExperience(work1Period,'5',work1SchoolOrWorkUnit,work1Reterence);
        	}else if(work1Id != ''){
        		updateWorkExperience(work1Id,work1Period,work1SchoolOrWorkUnit,work1Reterence);
        	}

            var work2Id = $.trim($("#work2Id").val());
            var work2Period = $.trim($("#work2Period").val());
            var work2SchoolOrWorkUnit = "";
            var work2Reterence = "";
            if(level=="1" ||  level=="2" || level=="3"  ){
                work2SchoolOrWorkUnit = $.trim($("#work2SchoolOrWorkUnit").val());
                work2Reterence = $.trim($("#work2Reterence").val());
            }
            if(work2Id == '' && (work2Period !='' || work2SchoolOrWorkUnit!='' || work2Reterence!='')){
        		saveWorkExperience(work2Period,'6',work2SchoolOrWorkUnit,work2Reterence);
        	}else if(work2Id != ''){
        		updateWorkExperience(work2Id,work2Period,work2SchoolOrWorkUnit,work2Reterence);
        	}
        	
        	var work3Id = $.trim($("#work3Id").val());
        	var work3Period = $.trim($("#work3Period").val());
            var work3SchoolOrWorkUnit = "";
            var work3Reterence = "";
            if(level=="1" ||  level=="2" || level=="3"  ){
                work3SchoolOrWorkUnit = $.trim($("#work3SchoolOrWorkUnit").val());
                work3Reterence = $.trim($("#work3Reterence").val());
            }
        	if(work3Id == '' && (work3Period !='' || work3SchoolOrWorkUnit!='' || work3Reterence!='')){
        		saveWorkExperience(work3Period,'7',work3SchoolOrWorkUnit,work3Reterence);
        	}else if(work3Id != ''){
        		updateWorkExperience(work3Id,work3Period,work3SchoolOrWorkUnit,work3Reterence);
        	}
        	
        	var studentId = $("#studentId").val();
        	$.ajax({
                type:'post',
                url:'${requestHost}/schoolroll/auth/workerInfo/check',
                contentType:'application/x-www-form-urlencoded; charset=utf-8',
                data:{
               	 studentId:studentId
                },
                success: function () {
                	window.location.href="/schoolroll/auth/typeIn";
                }
            });
        	
        });
        
        function saveWorkExperience(period, experienceType, schoolOrWorkUnit, reterence){
        	 $.ajax({
                 type:'post',
                 url:'${requestHost}/schoolroll/auth/workerInfo/save',
                 contentType:'application/x-www-form-urlencoded; charset=utf-8',
                 data:{
                	 period:period,
                	 experienceType:experienceType,
                	 schoolOrWorkUnit:schoolOrWorkUnit,
                	 reterence:reterence
                 },
                 success: function (result) {
                	console.log(result);
                 }
             });
        }
        
		function updateWorkExperience(id, period, schoolOrWorkUnit, reterence){
			$.ajax({
                type:'post',
                url:'${requestHost}/schoolroll/auth/workerInfo/update',
                contentType:'application/x-www-form-urlencoded; charset=utf-8',
                data:{
               	 id:id,
               	 period:period,
               	 schoolOrWorkUnit:schoolOrWorkUnit,
               	 reterence:reterence
                },
                success: function (result) {
                	console.log(result);
                }
            });
        }
        
		function showLoading(){
		    document.getElementById("over").style.display = "block";
		    document.getElementById("layout").style.display = "block";
		}
		
		function hideLoading(){
		    document.getElementById("over").style.display = "none";
		    document.getElementById("layout").style.display = "none";
		}
		
    });
</script>
    <style type="text/css">
    	.editMood{
            color: #333;
        }
         .current a {
             font-size: 20px;
         }
 
         .over {
             display: none;
             position: absolute;
             top: 0;
             left: 0;
             width: 100%;
             height: 100%;
             background-color: #f5f5f5;
             opacity:0.5;
             z-index: 1000;
         }

        .layout {
            display: none;
            position: absolute;
            top: 40%;
            left: 40%;
            width: 20%;
            height: 20%;
            z-index: 1001;
            text-align:center;
        }
    </style>
</head>


<body style="background-color:#f8f8f8;">
<div class="dlny clear">
   <dl>
      <dt><a href="/edu/auth/toEditHeadprotrait"><img src="${headPortrait}"></a></dt>
      <dd>
          [${studentName}] <a href="/edu/auth/toEditStudentInfo" class="editMood">${mood}</a>
      </dd>
   </dl>
</div>

<div class="baobiao">
	<div id="over" class="over"></div>
	<div id="layout" class="layout"><img src="http://${staticHost}/images/loading.gif" /></div>
    <h5>本人简历<b>（以下某个阶段如果没有经历过，可忽略该阶段）</b></h5>
    <div class="baobiao_p">
       <table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
        <td width="12%">&nbsp;</td>
        <td>从何年何月起至何年何月止</td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
        <td>何地何学校或何单位任何职</td>
        <td>证明人</td>
      #end

  </tr>
  <tr>
  	<input type="hidden" id="studentId" value="$studentId" />
  	<input type="hidden" id="level" value="$ssi.level" />
    <td>小学</td>
    	<input id="primaryId" type="hidden" value="#if (!$primary.id) #else $primary.id #end">
    <td><input id="primaryPeriod" type="text" value="#if (!$primary.period) #else $primary.period #end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
    <td><input id="primarySchoolOrWorkUnit" type="text" value="#if (!$primary.schoolOrWorkUnit) #else $primary.schoolOrWorkUnit #end"></td>
    <td><input id="primaryReterence" type="text" value="#if (!$primary.reterence) #else $primary.reterence #end"></td>
      #end
  </tr>
  <tr>
    <td>初中</td>
    	<input id="juniorId" type="hidden" value="#if (!$junior.id) #else $junior.id #end">
    <td><input id="juniorPeriod" type="text" value="#if (!$junior.period) #else $junior.period #end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
    <td><input id="juniorSchoolOrWorkUnit" type="text" value="#if (!$junior.schoolOrWorkUnit) #else $junior.schoolOrWorkUnit #end"></td>
    <td><input id="juniorReterence" type="text" value="#if (!$junior.reterence) #else $junior.reterence #end"></td>
      #end
  </tr>
  <tr>
    <td>高中</td>
     	<input id="seniorId" type="hidden" value="#if (!$senior.id) #else $senior.id #end">
    <td><input id="seniorPeriod" type="text" value="#if (!$senior.period) #else $senior.period #end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
    <td><input id="seniorSchoolOrWorkUnit" type="text" value="#if (!$senior.schoolOrWorkUnit) #else $senior.schoolOrWorkUnit #end"></td>
    <td><input id="seniorReterence" type="text" value="#if (!$senior.reterence) #else $senior.reterence #end"></td>
      #end
  </tr>
  #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
  <tr>
    <td>大学</td>
    <input id="collegeId" type="hidden" value="#if (!$college.id) #else $college.id #end">
    <td><input id="collegePeriod" type="text" value="#if (!$college.period) #else $college.period #end"></td>
    <td><input id="collegeSchoolOrWorkUnit" type="text" value="#if (!$college.schoolOrWorkUnit) #else $college.schoolOrWorkUnit #end"></td>
    <td><input id="collegeReterence" type="text" value="#if (!$college.reterence) #else $college.reterence #end"></td>
  </tr>
  #end
  <tr>
    <td>工作1</td>
    	<input id="work1Id" type="hidden" value="#if (!$work1.id)#else$work1.id#end">
	    <td><input id="work1Period" type="text" value="#if (!$work1.period)#else$work1.period#end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
	    <td><input id="work1SchoolOrWorkUnit" type="text" value="#if (!$work1.schoolOrWorkUnit)#else$work1.schoolOrWorkUnit #end"></td>
	    <td><input id="work1Reterence" type="text" value="#if (!$work1.reterence)#else$work1.reterence#end"></td>
      #end
  </tr>
  <tr>
    <td>工作2</td>
    	<input id="work2Id" type="hidden" value="#if (!$work2.id)#else$work2.id#end">
	    <td><input id="work2Period" type="text" value="#if (!$work2.period)#else$work2.period#end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
	    <td><input id="work2SchoolOrWorkUnit" type="text" value="#if (!$work2.schoolOrWorkUnit)#else$work2.schoolOrWorkUnit#end"></td>
	    <td><input id="work2Reterence" type="text" value="#if (!$work2.reterence)#else$work2.reterence#end"></td>
      #end
  </tr>
  <tr>
    <td>工作3</td>
    	<input id="work3Id" type="hidden" value="#if (!$work3.id)#else$work3.id #end">
	    <td><input id="work3Period" type="text" value="#if (!$work3.period)#else$work3.period#end"></td>
      #if ($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3 )
	    <td><input id="work3SchoolOrWorkUnit" type="text" value="#if (!$work3.schoolOrWorkUnit)#else$work3.schoolOrWorkUnit#end"></td>
	    <td><input id="work3Reterence" type="text" value="#if (!$work3.reterence)#else$work3.reterence#end"></td>
      #end
  </tr>
</table>

    </div>
   <div class="md_dl"><input name="" id="submitForm" type="image" src="http://${staticHost}/images/tj01.jpg" style="width:290px; height:42px; border:none; margin-top:20px; margin-bottom:30px;" /></div>
</div>

<div class="holderdiv"></div>
<div class="fixdiv">
  <ul>               
    <li>
    	#if($ssi.universityFillStatus == 1 && $ssi.baseInfoFillStatus == 1 && $ssi.workExperienceFillStatus == 1 && $ssi.familyFillStatus == 1)
    		<a href="/internal/auth/myClass">
    	#else
    		<a href="javascript:void(0)" onclick="window.history.go(-1)">
    	#end
    	<img src="http://${staticHost}/images/foticon001.jpg"><span>返回</span></a></li>
    <li><a href="/edu/auth/modifyPwd"><img src="http://${staticHost}/images/foticon004.jpg"><span>重置密码</span></a></li>
	<li><a href="javascript:void(0)" onclick="loginOut()"><img src="http://${staticHost}/images/foticon003.jpg"><span>退出系统</span></a></li>
  </ul>
</div>

</body>
</html>